<template>
	<u-tabbar
		:value="props.value"
		:fixed="true"
		:placeholder="true"
		:safeAreaInsetBottom="true"
		activeColor="#D93954"
		:zIndex="999"
		inactiveColor="#999999">
		<u-tabbar-item text="首页" @click="jump(0)">
			<!-- <template #active-icon>
				<image mode="aspectFill" class="u-page__item__slot-icon" src="https://aph.junhecms.com/tabBar/a1.png"></image>
			</template>
			<template #inactive-icon>
				<image mode="aspectFill" class="u-page__item__slot-icon" src="https://aph.junhecms.com/tabBar/ua1.png"></image>
			</template> -->
		</u-tabbar-item>
		<u-tabbar-item text="产品中心" @click="jump(1)">
			<!-- 	<template #active-icon>
				<image
					class="u-page__item__slot-icon"
					src="https://aph.junhecms.com/tabBar/a2.png"></image>
			</template>
			<template #inactive-icon>
				<image
					class="u-page__item__slot-icon"
					src="https://aph.junhecms.com/tabBar/ua2.png"></image>
			</template> -->
		</u-tabbar-item>
		<u-tabbar-item text="行业洞察" @click="jump(2)">
			<!-- <template #active-icon>
				<image
					class="u-page__item__slot-icon"
					src="https://aph.junhecms.com/tabBar/a3.png"></image>
			</template>
			<template #inactive-icon>
				<image
					class="u-page__item__slot-icon"
					src="https://aph.junhecms.com/tabBar/ua3.png"></image>
			</template> -->
		</u-tabbar-item>
		<u-tabbar-item text="联系我们" @click="jump(3)">
			<!-- <template #active-icon>
				<image
					class="u-page__item__slot-icon"
					src="https://aph.junhecms.com/tabBar/a4.png"></image>
			</template>
			<template #inactive-icon>
				<image
					class="u-page__item__slot-icon"
					src="https://aph.junhecms.com/tabBar/ua4.png"></image>
			</template> -->
		</u-tabbar-item>
	</u-tabbar>
</template>

<script setup>
import { ref } from 'vue';

const props = defineProps({
	value: {
		type: Number,
		default: -1
	}
});

const jump = (type) => {
	let url;
	if (type === 0) url = '/pages/homePage/index';
	else if (type === 1) url = '/pages/product/index';
	else if (type === 2) url = '/pages/profession/index';
	else if (type === 3) url = '/pages/us/index';
	uni.redirectTo({
		url: url
	});
};
</script>

<style lang="scss" scoped>
.u-page__item__slot-icon {
	width: 60rpx;
	height: 60rpx;
}
</style>
